package com.gzhryc.shared_device.cdcz.code.dao.enums;

public class CDCZOrderEnum {

    public static enum State {

        WaitStart(1,"等待开启")
        ,Opening(2,"开启中")
        ,Working(3, "使用中")
        ,Fail(4, "开启失败")
        ,Finish(5, "已完成")
        ,Close(6, "已关闭");

        private Integer index;
        private String note;

        State(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            State[] temp = State.values();
            for (int i = 0; i < temp.length; i++) {
                State item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum StopMode {

        Unknown(0,"未知")
        ,TimesFillStop(1,"时间到停")
        ,MaxPowerFillStop(2, "电量到停")
        ,PowerFillStop(3, "充满自停")
        ,OutStop(4, "拔出超时停")
        ,ForceStop(5, "强制停");

        private Integer index;
        private String note;

        StopMode(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            StopMode[] temp = StopMode.values();
            for (int i = 0; i < temp.length; i++) {
                StopMode item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public static enum PayState {

        Payment(1, "持续扣费"), Success(2, "支付成功"),Cancel(4, "撤销支付");

        private Integer index;
        private String note;

        PayState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            PayState[] temp = PayState.values();
            for (int i = 0; i < temp.length; i++) {
                PayState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

}
